package xyz.molzhao.util;

import cn.hutool.crypto.symmetric.AES;

import java.nio.charset.StandardCharsets;

public class AESUtil {
    private AESUtil() {

    }

    /**
     * 加密Key
     */
    private static final String ENCRYPT_KEY = "1234567890123456";

    /**
     * 初始化加密工具
     */
    private static final AES aes = new AES(ENCRYPT_KEY.getBytes(StandardCharsets.UTF_8));


    public static String encryptHex(String data) {
        return aes.encryptHex(data.getBytes(StandardCharsets.UTF_8));
    }

    public static String decryptStr(String data) {
        return aes.decryptStr(data);
    }
}
